
package simulator.engine;

import java.util.Random;

/**
 * Denne klassen tilfører en del tilfeldighet til alle strømforbruksberegninger
 * @author 490501
 */
public class Entropy {
    
    private float entropyPersentage;
    private Random gaussGenerator;
    
    /**
     * 
     * @param _persentage deviations prosent
     */
    public Entropy(float _persentage) {
        this.gaussGenerator = new Random();
        this.entropyPersentage = _persentage;
    }
    /**
     * 
     * @param _value value that will be deviated
     * @return value deviated in terms of normal distribution and deviation persentage
     */
    public double deviateValue(double _value) {
        return _value + (_value/100*this.entropyPersentage)*this.gaussGenerator.nextGaussian();
    }
    
}
